#ifndef USBCAMERA_HPP
#define USBCAMERA_HPP

#include "camerabasea.hpp"

#include <opencv2/opencv.hpp>


class USBCamera : public cv::VideoCapture, public CameraBaseA
{
public:
    USBCamera()
    {

    }

    virtual bool open(int mode)
    {
        bool res = cv::VideoCapture::open(mode);
        if(res)
        {
            cv::VideoCapture::set(CV_CAP_PROP_FRAME_WIDTH, 640);
            cv::VideoCapture::set(CV_CAP_PROP_FRAME_HEIGHT, 480);
        }
        return res;
    }

    virtual bool read(cv::Mat &image)
    {
        return cv::VideoCapture::read(image);
    }

    cv::Size FrameSize()
    {
        return cv::Size(cv::VideoCapture::get(CV_CAP_PROP_FRAME_WIDTH), cv::VideoCapture::get(CV_CAP_PROP_FRAME_HEIGHT));
    }

    virtual void release()
    {
        return cv::VideoCapture::release();
    }    

};
#endif // ODROIDCAMERA_HPP

